<template>
  <div>
    <button @click="comName = 'PartSixPanel'">个人信息填写</button>
    <button @click="comName = 'PartSevenPanel'">账号密码填写</button>

    <p>组件缓存:</p>
    <div style="border: 1px solid red;">
      <!-- Vue内置keep-alive组件, 把包起来的组件缓存起来 -->
      <keep-alive>
        <component :is="comName"></component>
      </keep-alive>
    </div>
  </div>
</template>

<script>
import PartSixPanel from "./PartSixPanel";
import PartSevenPanel from "./PartSevenPanel";

export default {
  name: "BasicApiSeven",
  data() {
    return {
      comName: "PartSixPanel"
    }
  },
  components: {
    PartSevenPanel,
    PartSixPanel
  }
}
</script>

<style scoped>

</style>
